import './Mars3dSetUp.scss'
import { Button } from 'antd'
import PropTypes from 'prop-types'

import { optionsList } from '../../Assets/Params'
import { UseConfigSection } from '../../Template/FormTemplate'

const Mars3dFitA04 = ({ data, Off, ModalEvent }) => {
    Mars3dFitA04.propTypes = { data: PropTypes.object, Off: PropTypes.func, ModalEvent: PropTypes.object }

    const list = [
        { key: 101, uuid: 'FitA04', label: '缩放地图', type: 'RadioTemp', name: 'enableZoom', options: optionsList.isEnable },
        { key: 102, uuid: 'FitA04', label: '倾斜相机', type: 'RadioTemp', name: 'enableTilt', options: optionsList.isEnable },
        { key: 103, uuid: 'FitA04', label: '旋转地图', type: 'RadioTemp', name: 'enableRotate', options: optionsList.isEnable },
        { key: 104, uuid: 'FitA04', label: '平移地图', type: 'RadioTemp', name: 'enableTranslate', options: optionsList.isEnable },
        { key: 105, uuid: 'FitA04', label: '进入地下', type: 'RadioTemp', name: 'enableCollisionDetection', options: optionsList.isEnable },
        { key: 106, uuid: 'FitA04', label: '最小碰撞高度', type: 'SliderTemp', name: 'minimumCollisionTerrainHeight', options: { min: 1, max: 500000 } },
        { key: 107, uuid: 'FitA04', label: '相机最近视距', type: 'SliderTemp', name: 'minimumZoomDistance', options: { min: 1, max: 10000 } },
        { key: 108, uuid: 'FitA04', label: '相机最远视距', type: 'SliderTemp', name: 'maximumZoomDistance', options: { min: 1, max: 90000000 } },
        { key: 109, uuid: 'FitA04', label: '滚轮放大倍数', type: 'SliderTemp', name: 'zoomFactor', options: { min: 1, max: 10 } },
    ]

    const onSubmit = () => {
        ModalEvent.emit({ type: 'scene', data })
        Off()
    }

    return (
        <div className='Mars3dSetUp Mars3dFitA04'>
            <div className='FormList'>
                {UseConfigSection(data, list)}
            </div>
            <div className='Button'>
                <Button type='primary' danger onClick={Off}>取消</Button>
                <Button type='primary' onClick={onSubmit}>保存</Button>
            </div>
        </div>
    );
};

export default Mars3dFitA04;